10 REM  COPYRIGHT APEX TRADING LTD. 1982. 
15 CALL CLEAR
20 RANDOMIZE
25 CALL SCREEN(2)
30 FOR J=1 TO 14
35 CALL COLOR(J,15,1)
40 NEXT J
45 N=1
50 READ RMN,T
55 DIM RM$(20),B(20,3),A$(20),MV(20,4),OB(4),RN$(20)
60 FOR I=1 TO 6
65 READ IN$
70 PRINT IN$: :
75 NEXT I
80 FOR I=1 TO RMN
85 READ RM$(I),RN$(I)
90 NEXT I
95 FOR I=1 TO RMN
100 READ A$(I)
105 NEXT I
110 FOR I=1 TO T
115 READ HZ$(I)
120 NEXT I
125 FOR I=1 TO RMN
130 READ MV(I,1),MV(I,2),MV(I,3),MV(I,4)
135 NEXT I
140 FOR I=1 TO RMN-T
145 R=INT(RND*RMN+1)
150 IF B(R,1)<>0 THEN 145
155 B(R,1)=I
160 NEXT I
165 TIM1=11
170 TIM2=30
175 FOR I=1 TO T
180 R=INT(RND*(RMN-2)+3)
185 IF B(R,3)<>0 THEN 180
190 B(R,3)=I
195 NEXT I
200 FOR I=(RMN-T)+1 TO RMN
205 R=INT(RMN*RND+1)
210 IF B(R,1)<>0 THEN 205
215 B(R,1)=I
220 B(R,2)=INT(RND*T+1)
225 NEXT I
230 INPUT "press enter to start":Q$
235 PRINT : : : :STR$(TIM1);":";STR$(TIM2): :
240 PRINT RM$(N): : : :RN$(N): :
245 INPUT "what now? ":Q$
250 PRINT : : : :
255 VC$="NSEWOT"
260 X=POS(VC$,Q$,1)
265 ON X+1 GOTO 715,270,270,270,270,345,415
270 IF MV(N,X)<>99 THEN 285
275 PRINT "you can't go that way!": :
280 GOTO 245
285 N=MV(N,X)
290 IF N=1 THEN 530
295 TIM2=TIM2+2
300 IF TIM2<>60 THEN 315
305 TIM1=0
310 TIM2=0
315 PRINT STR$(TIM1);":";STR$(TIM2): :
320 PRINT RM$(N): : : :RN$(N): : : :
325 FL2=0
330 FLT=0
335 IF B(N,3)=0 THEN 245
340 GOTO 640
345 IF FL2=1 THEN 705
350 IF B(N,1)<>0 THEN 365
355 PRINT "it's empty!": :
360 GO TO 245
365 IF B(N,2)=0 THEN 400
370 K=B(N,2)
375 FOR I=1 TO 3
380 IF OB(I)=K THEN 400
385 NEXT I
390 PRINT "you need a ";A$(K);"to get in there!": :
395 GOTO 245
400 PRINT "there's a ";A$(B(N,1));" in there": :
405 FLT=1
410 GOTO 245
415 IF FL2=1 THEN 705
420 IF FLT=0 THEN 725
425 FOR I=1 TO 3
430 IF OB(I)=0 THEN 450
435 NEXT I
440 PRINT "you can only carry three  objects - leave one behind"
445 GOTO 470
450 OB(I)=B(N,1)
455 B(N,1)=0
460 PRINT "it's yours": :
465 GOTO 245
470 PRINT "1. ";A$(OB(1))
475 PRINT "2. ";A$(OB(2))
480 PRINT "3. ";A$(OB(3))
485 PRINT "4. ";A$(B(N,1))
490 INPUT "leave which number? ":Q
495 PRINT : :
500 IF Q>4 THEN 490
505 IF Q=4 THEN 245
510 TH=OB(Q)
515 OB(Q)=B(N,1)
520 B(N,1)=TH
525 GOTO 245
530 PRINT "leaving so soon? value of   items taken is";
535 FOR I=1 TO 3
540 IF OB(I)<RMN-T+1 THEN 550
545 VL=VL+OB(I)*100
550 NEXT I
555 PRINT VL: : : :
560 INPUT "like to try again? ":Q$
565 IF SEG$(Q$,1,1)="N" THEN 635
570 FLT=0
575 N=1
580 CALL CLEAR
585 FOR I=1 TO RMN
590 B(I,1)=0
595 B(I,2)=0
600 OB(1)=0
605 OB(2)=0
610 OB(3)=0
615 VL=0
620 B(I,3)=0
625 NEXT I
630 GOTO 140
635 END
640 IF TIM1=11 THEN 245
645 PRINT HZ$(B(N,3)): :
650 GOSUB 1130
655 CH=INT(RND*2+1)
660 IF CH=1 THEN 695
665 PRINT "you've escaped but lost     everything you carried.": :
670 OB(1)=0
675 OB(2)=0
680 OB(3)=0
685 FL2=1
690 GOTO 245
695 PRINT "aaaargh! there is no escape!": :
700 GOTO 560
705 PRINT "running....": :
710 GOTO 245
715 PRINT "use N S E W O or T please": :
720 GOTO 245
725 PRINT "theres nothing to take!": :
730 GOTO 245
735 DATA 18,4
740 DATA haunted house
745 DATA you are about to explore a  haunted house and perhaps   find treasure.
750 DATA to move use any of the      following commands.
755 DATA N (=north)   S (=south)     W (=west)    E (=east)      O (=open)    T (=take item)
760 DATA objects will be found       around the house. some will help you gain access to the treasure.
765 DATA the time is now 11:30 stay  after midnight at your      peril!
770 DATA you are standing at the gateof a gloomy victorian       mansion which lies to your  north.
775 DATA if you dare press N and     enter.....
780 DATA you are on the southern sideof the house facing the     boarded-up front door.
785 DATA there is a grey stone tomb  nearby. perhaps it could be opened?
790 DATA you are at the back of the  house. a shed lies to the   north and a conservatory to the south.
795 DATA an old toolbox lies at your feet.
800 DATA you are on the eastern side of the house. steps to the  south lead to a cellar.
805 DATA an ivy clad outhouse stands against the wall.
810 DATA you are in a gloomy passage way. there are doors on all four sides.
815 DATA a mould covered laundry     basket is on the floor.
820 DATA you are in the kitchen. to  the west is a pantry. to theeast a door.
825 DATA a rusty oven is against one wall.
830 DATA you are in the pantry. to   the east is a door. a       boarded-up window to the    west.
835 DATA mouldy food lines the       shelves. a rusty meat safe  on one wall.
840 DATA a study. the only entrance  is to the south.
845 DATA the room is bare apart from a crumbling desk in the     centre.
850 DATA a drawing room. there are   doors to the north and east.
855 DATA thick dust covers the       furniture and cupboard.
860 DATA a dining room. doors to the south and west.
865 DATA decaying dust sheets cover  the table chairs and side-  board.
870 DATA the library. doors to the   north and south. mouldy     books line the walls.
875 DATA a rusted filing cabinet     stands against one wall.
880 DATA a reception room. doors to  n w and e. dust sheets coverthe furniture. in the centreof the room....
885 DATA ....is a coffin!!
890 DATA you are in a dingy hallway. the boarded-up front door isto the south. other doors ton w and east.
895 DATA the stairs have fallen away.only the cupboard beneath   remains.
900 DATA you are in the rotting      garden shed. the door behindyou to the south. the floor moves as you enter
905 DATA an old gardeners tool box   rests against one wall.
910 DATA you are in a dark damp      cellar room. the door is    behind you to the west.     steps lead to the garden (n)
915 DATA all you can see is a        crumbling wooden chest on   the floor.
920 DATA you are in the conservatory.a door behind you to the n  and one in front to the s.
925 DATA an old child's toy box is onthe floor.
930 DATA you are to the west of the  house. an old coach house isto your west.
935 DATA a coal-bunker smothered withivy rests against the wall  of the house.
940 DATA you are in the coach house. the door behind you to the  east.
945 DATA a suitcase lies discarded   at one end.
950 DATA key
955 DATA hammer
960 DATA hacksaw
965 DATA screwdriver
970 DATA dead rat
975 DATA mouldy loaf
980 DATA layer of dust
985 DATA child's top
990 DATA spider
995 DATA cobweb
1000 DATA cup
1005 DATA mouse
1010 DATA can of oil
1015 DATA glass eye
1020 DATA bag of coins
1025 DATA bundle of banknotes
1030 DATA a diamond necklace
1035 DATA gold bar
1040 DATA a skull!! it moves!...
1045 DATA invisible hands clutch at   your body....
1050 DATA an ice cold mist envelops   you....
1055 DATA a ghoul appears and moves   towards you....
1060 DATA 2,1,1,1
1065 DATA 99,1,4,17
1070 DATA 14,16,4,17
1075 DATA 3,15,99,99
1080 DATA 16,13,10,6
1085 DATA 99,99,5,7
1090 DATA 99,99,6,99
1095 DATA 99,9,99,99
1100 DATA 8,99,13,99
1105 DATA 99,11,99,5
1110 DATA 10,12,99,99
1115 DATA 11,99,15,13
1120 DATA 5,99,12,9
1125 DATA 99,3,99,99,4,99,99,12,3,5,99,99,3,2,3,18,99,99,17,99
1130 FOR D=1 TO 1900
1135 NEXT D
1140 RETURN
